package com.lxy.dto;

/**
 * 所有ajax请求返回类型，封装json返回结果
 * @author Manaka
 * @date 2020-03-05 16:48
 */
public class SecKillResult<T> {

    private boolean success;

    private T data;

    private String error;

    /**
     * 成功时返回数据
     * @param success true
     * @param data
     */
    public SecKillResult(boolean success, T data) {
        this.success = success;
        this.data = data;
    }

    /**
     * 失败时返回数据
     * @param success
     * @param error
     */
    public SecKillResult(boolean success, String error) {
        this.success = success;
        this.error = error;
    }


    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }
}
